<?php
include 'user_form_lib.php';

$a_css_files = array (
    /*
     * Profile Form
     */
    array ( 'path' => 'plugins/jquery-ui/jquery-ui-1.10.1.custom.min.css' ),
    
    
    /*
     * File Upload
     */
    array ( 'path' => 'plugins/bootstrap-fileupload/bootstrap-fileupload.css' ),
    array ( 'path' => 'plugins/bootstrap-modal/css/bootstrap-modal.css' ),
    array ( 'path' => 'css/pages/nh-user-form.css' ),
);

$a_js_files = array (
    /*
     * Profile Form
     */
    array ( 'path' => 'plugins/jquery-validation/dist/jquery.validate.min.js' ),
    
    /*
     * File Upload
     */
    array ( 'path' => 'plugins/bootstrap-wizard/jquery.bootstrap.wizard.min.js' ),
    array ( 'path' => 'plugins/bootstrap-fileupload/bootstrap-fileupload.js' ),
    array ( 'path' => 'plugins/jquery-validation/dist/additional-methods.min.js' ),
    array ( 'path' => 'plugins/jquery-file-upload/js/vendor/tmpl.min.js' ),
    array ( 'path' => 'plugins/jquery-file-upload/js/vendor/jquery.ui.widget.js' ),
    array ( 'path' => 'plugins/jquery-file-upload/js/jquery.iframe-transport.js' ),
    array ( 'path' => 'plugins/jquery-file-upload/js/jquery.fileupload.js' ),
    array ( 'path' => 'plugins/bootstrap-modal/js/bootstrap-modal.js' ),
    array ( 'path' => 'plugins/bootstrap-modal/js/bootstrap-modalmanager.js' ),
    array ( 'path' => 'scripts/nh-user-form.js' ),
);

$a_js_class[] = 'User_Form.init();';

$a_permission = get_passport_action_from_module($db_conn, array('THEM_THANH_VIEN'));
include 'lib_head.php';
?>
<div class="row-fluid">
    <div class="tabbable tabbable-custom tabbable-custom-profile">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#insert-by-info" data-toggle="tab">Thêm Thành Viên</a></li>
            <li><a href="#insert-by-file" data-toggle="tab">Thêm Qua File Excel</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane form active" id="insert-by-info">
            <?php if (in_array('insert-profile', $a_permission)) { ?>
                <form method="post" id="form-profile" action="user_form_execute.php?action=insert-profile" class="horizontal-form">
                    <div class="alert alert-error hide">
                        <button class="close" data-dismiss="alert"></button>
                        Kiểm tra lại thông tin bên dưới.
                    </div>
                    <div class="row-fluid">
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label" for="saint">Tên Thánh</label>
                                <div class="controls">
                                    <input type="text" name="saint" id="saint" class="m-wrap span12" placeholder="Giuse">
                                </div>
                            </div>
                        </div>
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label" for="username">Họ và Tên <span class="required">*</span></label>
                                <div class="controls">
                                    <input type="text" name="username" id="username" class="m-wrap span12" placeholder="Nguyễn Văn A">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label" for="passwd">Mật Khẩu<span class="required">*</span></label>
                                <div class="controls">
                                    <input type="password" name="passwd" id="passwd" autocomplete="off" class="m-wrap span12">
                                </div>
                            </div>
                        </div>
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label" for="retypepasswd">Nhập Lại Mật Khẩu<span class="required">*</span></label>
                                <div class="controls">
                                    <input type="password" name="retypepasswd" id="retypepasswd" autocomplete="off" class="m-wrap span12">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label" >Giới Tính</label>
                                <div class="controls">
                                    <select name="gender" class="m-wrap span12">
                                        <?php foreach ($a_GoiTinh as $v_key => $v_value) { ?>
                                            <option value="<?=$v_key?>"><?= $v_value ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label" for="birthday">Ngày Sinh</label>
                                <div class="controls">
                                    <input type="text" name="birthday" id="birthday" class="m-wrap datepicker span12" placeholder="24-12-0000">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4 ">
                            <div class="control-group">
                                <label class="control-label" for="baptism_date">Rửa Tội</label>
                                <div class="controls">
                                    <input type="text" name="baptism_date" id="baptism_date" class="m-wrap datepicker span12" placeholder="24-12-0000">
                                </div>
                            </div>
                        </div>
                        <div class="span4 ">
                            <div class="control-group">
                                <label class="control-label" for="eucharist_date">Rước Lễ</label>
                                <div class="controls">
                                    <input type="text" name="eucharist_date" id="eucharist_date" class="m-wrap datepicker span12" placeholder="24-12-0000">
                                </div>
                            </div>
                        </div>
                        <div class="span4 ">
                            <div class="control-group">
                                <label class="control-label" for="confirmation_date">Thêm Sức</label>
                                <div class="controls">
                                    <input type="text" name="confirmation_date" id="confirmation_date" class="m-wrap datepicker span12" placeholder="24-12-0000">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label">Phân Loại</label>
                                <div class="controls">
                                    <select name="usertype" class="m-wrap span12">
                                        <?php foreach ($a_Loai_TaiKhoan as $v_key => $v_value) { ?>
                                            <option value="<?=$v_key?>"><?= $v_value ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="span6 ">
                            <div class="control-group">
                                <label class="control-label">Phân Ban</label>
                                <div class="controls">
                                    <select name="usercrew" class="m-wrap span12">
                                        <option value=""></option>
                                        <?php foreach ($a_PhanBan as $v_key => $v_value) : ?>
                                            <option value="<?=$v_key?>"><?= $v_value ?></option>
                                        <?php endforeach; ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12 ">
                            <div class="control-group">
                                <label class="control-label">Lớp</label>
                                <div class="controls">
                                    <select name="team" class="m-wrap span4">
                                        <option value=""></option>
                                        <?php foreach ($a_Nganh as $v_key => $v_value) { ?>
                                            <option value="<?=$v_key?>"><?= $v_value ?></option>
                                        <?php } ?>
                                    </select>
                                    <select name="level" class="m-wrap span4">
                                        <option value=""></option>
                                        <?php foreach ($a_Cap as $v_key => $v_value) { ?>
                                            <option value="<?=$v_key?>"><?= $v_value ?></option>
                                        <?php } ?>
                                    </select>
                                    <select name="crew" class="m-wrap span4">
                                        <option value=""></option>
                                        <?php foreach ($a_Doi as $v_key => $v_value) { ?>
                                            <option value="<?=$v_key?>"><?= $v_value ?></option>
                                        <?php } ?>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <h3 class="form-section">Liên Lạc</h3>
                    <div class="row-fluid">
                        <div class="span4 ">
                            <div class="control-group">
                                <label class="control-label" for="email">Email</label>
                                <div class="controls input-icon">
                                    <input type="text" name="email" id="email" class="m-wrap span12" placeholder="demo@email.com">
                                </div>
                            </div>
                        </div>
                        <div class="span4 ">
                            <div class="control-group">
                                <label class="control-label" for="mobile">ĐTDĐ</label>
                                <div class="controls">
                                    <input type="text" name="mobile" id="mobile" class="m-wrap span12" placeholder="093 123 456">
                                </div>
                            </div>
                        </div>
                        <div class="span4 ">
                            <div class="control-group">
                                <label class="control-label" for="phone">ĐT Nhà</label>
                                <div class="controls">
                                    <input type="text" name="phone" id="phone" class="m-wrap span12" placeholder="39 123 456">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12 ">
                            <div class="control-group">
                                <label class="control-label" for="address">Địa Chỉ</label>
                                <div class="controls">
                                    <input type="text" name="address" id="address" class="m-wrap span12" placeholder="123 Tên Đường, Phường, Quận" />
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span12 ">
                            <div class="control-group">
                                <label class="control-label" for="note" >Ghi Chú</label>
                                <div class="controls">
                                    <textarea rows="3" name="note" id="note" class="span12 m-wrap"></textarea>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions">
                        <button type="submit" class="btn green"><i class="icon-ok"></i> Tạo</button>
                    </div>
                </form>
            <?php } ?>
            </div>
            <div class="tab-pane form" id="insert-by-file">
            <?php if (in_array('insert-by-file', $a_permission)) { ?>
                <div class="form-wizard" id="form_wizard">
                    <div class="navbar steps">
                        <div class="navbar-inner">
                            <ul class="row-fluid">
                                <li class="span4">
                                    <a href="#tab1" data-toggle="tab" class="step ">
                                        <span class="number">1</span>
                                        <span class="desc"><i class="icon-ok"></i> Chọn Dữ Liệu</span>   
                                    </a>
                                </li>
                                <li class="span4">
                                    <a href="#tab2" data-toggle="tab" class="step">
                                        <span class="number">2</span>
                                        <span class="desc"><i class="icon-ok"></i> Xác Nhận Dữ Liệu</span>   
                                    </a>
                                </li>
                                <li class="span4">
                                    <a href="#tab3" data-toggle="tab" class="step">
                                        <span class="number">3</span>
                                        <span class="desc"><i class="icon-ok"></i> Hoàn Tất</span>   
                                    </a>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div id="bar" class="progress progress-success progress-striped">
                        <div class="bar process-bar"></div>
                    </div>
                    <div class="tab-content">
                        <div class="alert alert-error alert-error-file hide">
                            <button class="close" data-dismiss="alert"></button>
                            Kiểm tra lại thông tin bên dưới.
                        </div>
                        <div class="alert alert-success alert-success-file hide">
                            <button class="close" data-dismiss="alert"></button>
                            Dữ liệu đúng.
                        </div>
                        <div class="tab-pane" id="tab1">
                            <form action="user_form_execute.php?action=checking-file" class="form-horizontal" id="form-file" method="post" enctype="multipart/form-data">
                                <h3 class="block">Thông tin File Excel</h3>
                                <div class="control-group">
                                    <label class="control-label">Khóa Học</label>
                                    <div class="controls">
                                        <select name="course" class="m-wrap span4">
                                            <?php for ($v_index = $a_KhoaHoc_Info['start_year']; $v_index > $a_KhoaHoc_Info['start_year'] - 10; $v_index--) { ?>
                                                <option value="<?= $v_index ?>"><?= $v_index ?> - <?= $v_index + 1 ?></option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">Phân Loại</label>
                                    <div class="controls">
                                        <select name="usertype" class="m-wrap span4">
                                            <?php foreach ($a_Loai_TaiKhoan as $v_key => $v_value) { ?>
                                                <option value="<?=$v_key?>"><?= $v_value ?></option>
                                            <?php } ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">Tập Tin Excel <span class="required">*</span></label>
                                    <div class="controls">
                                        <!-- The global progress bar -->
                                        <div class="progress progress-striped success-percent hide active" style="height: 30px;">
                                            <div class="bar upload-bar"></div>
                                        </div>
                                        <span class="btn btn-file">
                                            <span class="fileupload-new">Chọn</span>
                                            <input type="file" name="file" id="file" class="default">
                                        </span>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div class="tab-pane" id="tab2">
                            <form action="user_form_execute.php?action=insert-by-file" class="form-horizontal" id="form-info" method="post">
                                <h3 class="block">Xác Nhận Thông Tin</h3>
                                <div class="flip-scroll">
                                    <table class="table-bordered table-striped table-condensed flip-content">
                                        <thead class="flip-content">
                                            <tr>
                                                <th>Họ và Tên   </th>
                                                <th>Ngày Sinh   </th>
                                                <th>Giới Tính   </th>
                                                <th>Lớp         </th>
                                                <th>ĐT Nhà      </th>
                                                <th>ĐTDĐ        </th>
                                                <th>Địa Chỉ     </th>
                                                <th>Cha         </th>
                                                <th>Mẹ          </th>
                                                <th>Rửa Tội     </th>
                                                <th>Rước Lễ     </th>
                                                <th>Thêm Sức    </th>
                                                <th>Giáo Họ     </th>
                                            </tr>
                                        </thead>
                                        <tbody id="body-tmp">
                                        </tbody>
                                    </table>
                                    <input type="hidden" class="course" name="course" />
                                    <input type="hidden" class="usertype" name="usertype" />
                                    <input type="hidden" class="flag-submitted" value="false"/>
                                    <script id="user-tmpl" type="text/x-tmpl">
                                        {% for (id in o) { 
                                            _tmp_team = '';
                                            if  ( o[id].team in o_team ) { _tmp_team = o_team[o[id].team]; }
                                            if  ( o[id].level in o_level ) { _tmp_team = _tmp_team + ' - ' + o_level[o[id].level]; }
                                            if  ( o[id].crew in o_crew ) { _tmp_team = _tmp_team + ' - ' + o_crew[o[id].crew]; }
                                            
                                            _tmp_gender = '';
                                            if  ( o[id].gender in o_gender ) { _tmp_gender = o_gender[o[id].gender]; }
                                        %}
                                        <tr class="user-infos" userid="{%=id%}">
                                            <td>
                                                {%=o[id].saint%} - {%=o[id].username%}
                                                <input type="hidden" tmp-name="saint" name="user_info[{%=id%}][saint]" value="{%=o[id].saint%}" />
                                                <input type="hidden" tmp-name="username" name="user_info[{%=id%}][username]" value="{%=o[id].username%}" />
                                            </td>
                                            <td>
                                                {%=o[id].birthday%}
                                                <input type="hidden" tmp-name="birthday" name="user_info[{%=id%}][birthday]" value="{%=o[id].birthday%}" />
                                            </td>
                                            <td>
                                                {%=_tmp_gender%}
                                                <input type="hidden" tmp-name="gender" name="user_info[{%=id%}][gender]" value="{%=o[id].gender%}" />
                                            </td>
                                            <td>
                                                {%=_tmp_team%}
                                                <input type="hidden" tmp-name="team" name="user_info[{%=id%}][team]" value="{%=o[id].team%}" />
                                                <input type="hidden" tmp-name="level" name="user_info[{%=id%}][level]" value="{%=o[id].level%}" />
                                                <input type="hidden" tmp-name="crew" name="user_info[{%=id%}][crew]" value="{%=o[id].crew%}" />
                                            </td>

                                            <td>
                                                {%=o[id].phone%}
                                                <input type="hidden" tmp-name="phone" name="user_info[{%=id%}][phone]" value="{%=o[id].phone%}" />
                                            </td>
                                            <td>
                                                {%=o[id].mobile%}
                                                <input type="hidden" tmp-name="mobile" name="user_info[{%=id%}][mobile]" value="{%=o[id].mobile%}" />
                                            </td>
                                            <td>
                                                {%=o[id].address%}
                                                <input type="hidden" tmp-name="address" name="user_info[{%=id%}][address]" value="{%=o[id].address%}" />
                                            </td>
                                            <td>
                                                {%=o[id].father_saint%} - {%=o[id].father_name%}
                                                <input type="hidden" tmp-name="father_saint" name="user_info[{%=id%}][father_saint]" value="{%=o[id].father_saint%}" />
                                                <input type="hidden" tmp-name="father_name" name="user_info[{%=id%}][father_name]" value="{%=o[id].father_name%}" />
                                            </td>
                                            <td>
                                                {%=o[id].mother_saint%} - {%=o[id].mother_name%}
                                                <input type="hidden" tmp-name="mother_saint" name="user_info[{%=id%}][mother_saint]" value="{%=o[id].mother_saint%}" />
                                                <input type="hidden" tmp-name="mother_name" name="user_info[{%=id%}][mother_name]" value="{%=o[id].mother_name%}" />
                                            </td>
                                            <td>
                                                {%=o[id].baptism_date%}
                                                <input type="hidden" tmp-name="baptism_date" name="user_info[{%=id%}][baptism_date]" value="{%=o[id].baptism_date%}" />
                                            </td>
                                            <td>
                                                {%=o[id].eucharist_date%}
                                                <input type="hidden" tmp-name="eucharist_date" name="user_info[{%=id%}][eucharist_date]" value="{%=o[id].eucharist_date%}" />
                                            </td>
                                            <td>
                                                {%=o[id].confirmation_date%}
                                                <input type="hidden" tmp-name="confirmation_date" name="user_info[{%=id%}][confirmation_date]" value="{%=o[id].confirmation_date%}" />
                                            </td>
                                            <td>
                                                {%=o[id].parish%}
                                                <input type="hidden" tmp-name="parish" name="user_info[{%=id%}][parish]" value="{%=o[id].parish%}" />
                                            </td>
                                        </tr>
                                        {% } %}
                                    </script>
                                </div>
                            </form>
                            
                        </div>
                        <div class="tab-pane" id="tab3">
                            <h3 class="block">Hoàn Tất</h3>
                            <div class="flip-scroll">
                                <table class="table-bordered table-striped table-condensed flip-content">
                                    <thead class="flip-content">
                                        <tr>
                                            <th>Mã Sô       </th>
                                            <th>Họ và Tên   </th>
                                            <th>Ngày Sinh   </th>
                                            <th>Giới Tính   </th>
                                            <th>Lớp         </th>
                                            <th>ĐT Nhà      </th>
                                            <th>ĐTDĐ        </th>
                                            <th>Địa Chỉ     </th>
                                            <th>Cha         </th>
                                            <th>Mẹ          </th>
                                            <th>Rửa Tội     </th>
                                            <th>Rước Lễ     </th>
                                            <th>Thêm Sức    </th>
                                            <th>Giáo Họ     </th>
                                        </tr>
                                    </thead>
                                    <tbody id="body-complete-tmp">
                                    </tbody>
                                </table>
                                <script id="user-complete-tmpl" type="text/x-tmpl">
                                    {% for (id in o) {

                                        _tmp_team = '';
                                        if  ( o[id].team in o_team ) { _tmp_team = o_team[o[id].team]; }
                                        if  ( o[id].level in o_level ) { _tmp_team = _tmp_team + ' - ' + o_level[o[id].level]; }
                                        if  ( o[id].crew in o_crew ) { _tmp_team = _tmp_team + ' - ' + o_crew[o[id].crew]; }

                                        _tmp_gender = '';
                                        if  ( o[id].gender in o_gender ) { _tmp_gender = o_gender[o[id].gender]; }
                                    %}
                                    <tr onclick="window.open('user_detail.php?userid={%=o[id].userid%}', '_blank');" style="cursor: pointer;" >
                                        <td>
                                            {%=o[id].userid%}
                                        </td>
                                        <td>
                                            {%=o[id].saint%} - {%=o[id].username%}
                                        </td>
                                        <td>
                                            {%=o[id].birthday%}
                                        </td>
                                        <td>
                                            {%=_tmp_gender%}
                                        </td>
                                        <td>
                                            {%=_tmp_team%}
                                        </td>
                                        <td>
                                            {%=o[id].phone%}
                                        </td>
                                        <td>
                                            {%=o[id].mobile%}
                                        </td>
                                        <td>
                                            {%=o[id].address%}
                                        </td>
                                        <td>
                                            {%=o[id].father_saint%} - {%=o[id].father_name%}
                                        </td>
                                        <td>
                                            {%=o[id].mother_saint%} - {%=o[id].mother_name%}
                                        </td>
                                        <td>
                                            {%=o[id].baptism_date%}
                                        </td>
                                        <td>
                                            {%=o[id].eucharist_date%}
                                        </td>
                                        <td>
                                            {%=o[id].confirmation_date%}
                                        </td>
                                        <td>
                                            {%=o[id].parish%}
                                        </td>
                                    </tr>
                                    {% } %}
                                </script>
                            </div>
                        </div>
                    </div>
                    <div class="form-actions clearfix">
                        <a href="javascript:;" class="btn button-previous">
                            <i class="m-icon-swapleft"></i> Quay Lại 
                        </a>
                        <a href="javascript:;" class="btn blue button-next">
                            Tiếp Tục <i class="m-icon-swapright m-icon-white"></i>
                        </a>
                        <a href="javascript:;" class="btn green button-submit">
                            Tạo Mới <i class="m-icon-swapright m-icon-white"></i>
                        </a>
                    </div>
                </div>
            <?php } ?>
            </div>
        </div>
    </div>
</div>
<div id="responsive" class="modal hide fade" tabindex="-1">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
        <h3>Cập Nhật Thông Tin</h3>
    </div>
    <div class="modal-body">
    </div>
    <div class="modal-footer">
        <button type="button" data-dismiss="modal" class="btn">Thoát</button>
        <button type="button" class="btn blue btn-save">Lưu</button>
    </div>
</div>
<script id="user-info-tmpl" type="text/x-tmpl">
    <input type="hidden" name="tmp_userid" value="{%=o.tmp_userid%}"> 
    <div class="row-fluid">
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="saint">Tên Thánh</label>
                <div class="controls">
                    <input type="text" value="{%=o.saint%}" name="saint" id="saint" class="m-wrap span12" placeholder="Giuse">
                </div>
            </div>
        </div>
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="username">Họ và Tên</label>
                <div class="controls">
                    <input type="text" value="{%=o.username%}" name="username" id="username" class="m-wrap span12" placeholder="Nguyễn Văn A">
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" >Giới Tính</label>
                <div class="controls">
                    <select name="gender" class="m-wrap span12">
                        <?php foreach ($a_GoiTinh as $v_key => $v_value) { ?>
                            <option value="<?=$v_key?>" {% if(o.gender == '<?=$v_key?>') { %} selected="selected" {% } %} ><?= $v_value ?></option>
                        <?php } ?>
                    </select>
                </div>
            </div>
        </div>
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="birthday">Ngày Sinh</label>
                <div class="controls">
                    <input type="text" value="{%=o.birthday%}" name="birthday" id="birthday" class="m-wrap datepicker span12" placeholder="24-12-0000">
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span4 ">
            <div class="control-group">
                <label class="control-label" for="baptism_date">Rửa Tội</label>
                <div class="controls">
                    <input type="text" value="{%=o.baptism_date%}" name="baptism_date" id="baptism_date" class="m-wrap datepicker span12" placeholder="24-12-0000">
                </div>
            </div>
        </div>
        <div class="span4 ">
            <div class="control-group">
                <label class="control-label" for="eucharist_date">Rước Lễ</label>
                <div class="controls">
                    <input type="text" value="{%=o.eucharist_date%}" name="eucharist_date" id="eucharist_date" class="m-wrap datepicker span12" placeholder="24-12-0000">
                </div>
            </div>
        </div>
        <div class="span4 ">
            <div class="control-group">
                <label class="control-label" for="confirmation_date">Thêm Sức</label>
                <div class="controls">
                    <input type="text" value="{%=o.confirmation_date%}" name="confirmation_date" id="confirmation_date" class="m-wrap datepicker span12" placeholder="24-12-0000">
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12 ">
            <div class="control-group">
                <label class="control-label">Lớp</label>
                <div class="controls">
                    <select name="team" class="m-wrap span4">
                        <option value=""></option>
                        <?php foreach ($a_Nganh as $v_key => $v_value) { ?>
                            <option value="<?=$v_key?>" {% if(o.team == '<?=$v_key?>') { %} selected="selected" {% } %} ><?= $v_value ?></option>
                        <?php } ?>
                    </select>
                    <select name="level" class="m-wrap span4">
                        <option value=""></option>
                        <?php foreach ($a_Cap as $v_key => $v_value) { ?>
                            <option value="<?=$v_key?>" {% if(o.level == '<?=$v_key?>') { %} selected="selected" {% } %} ><?= $v_value ?></option>
                        <?php } ?>
                    </select>
                    <select name="crew" class="m-wrap span4">
                        <option value=""></option>
                        <?php foreach ($a_Doi as $v_key => $v_value) { ?>
                            <option value="<?=$v_key?>" {% if(o.crew == '<?=$v_key?>') { %} selected="selected" {% } %} ><?= $v_value ?></option>
                        <?php } ?>
                    </select>
                </div>
            </div>
        </div>
    </div>
    <h3 class="form-section">Liên Lạc</h3>
    <div class="row-fluid">
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="father_saint">Tên Thánh Cha</label>
                <div class="controls">
                    <input type="text" value="{%=o.father_saint%}" name="father_saint" id="father_saint" class="m-wrap span12" placeholder="Giuse">
                </div>
            </div>
        </div>
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="father_name">Họ và Tên Cha</label>
                <div class="controls">
                    <input type="text" value="{%=o.father_name%}" name="father_name" id="father_name" class="m-wrap span12" placeholder="Nguyễn Văn B">
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="mother_saint">Tên Thánh Mẹ</label>
                <div class="controls">
                    <input type="text" value="{%=o.mother_saint%}" name="mother_saint" id="mother_saint" class="m-wrap span12" placeholder="Maria">
                </div>
            </div>
        </div>
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="mother_name">Họ và Tên Mẹ</label>
                <div class="controls">
                    <input type="text" value="{%=o.mother_name%}" name="mother_name" id="mother_name" class="m-wrap span12" placeholder="Lê Thị C">
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="mobile">ĐTDĐ</label>
                <div class="controls">
                    <input type="text" value="{%=o.mobile%}" name="mobile" id="mobile" class="m-wrap span12" placeholder="093 123 456">
                </div>
            </div>
        </div>
        <div class="span6 ">
            <div class="control-group">
                <label class="control-label" for="phone">ĐT Nhà</label>
                <div class="controls">
                    <input type="text" value="{%=o.phone%}" name="phone" id="phone" class="m-wrap span12" placeholder="39 123 456">
                </div>
            </div>
        </div>
    </div>
    <div class="row-fluid">
        <div class="span12 ">
            <div class="control-group">
                <label class="control-label" for="address">Địa Chỉ</label>
                <div class="controls">
                    <input type="text" value="{%=o.address%}" name="address" id="address" class="m-wrap span12" placeholder="123 Tên Đường, Phường, Quận" />
                </div>
            </div>
        </div>
    </div>
</script>
<script type="text/javascript">
    var o_gender= <?=json_encode($a_GoiTinh)?>;
    var o_team  = <?=json_encode($a_Nganh)?>;
    var o_level = <?=json_encode($a_Cap)?>;
    var o_crew  = <?=json_encode($a_Doi)?>;
</script>
<?php include 'lib_tail.php'; ?>